package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhPlatformUserMapper;
import com.ruoyi.zsyh.domain.ZsyhPlatformUser;
import com.ruoyi.zsyh.service.IZsyhPlatformUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 平台客户档案Service业务层处理
 * 
 * @author yuexl
 * @date 2021-12-21
 */
@Service
public class ZsyhPlatformUserServiceImpl implements IZsyhPlatformUserService 
{
    @Autowired
    private ZsyhPlatformUserMapper zsyhPlatformUserMapper;

    /**
     * 查询平台客户档案
     * 
     * @param id 平台客户档案ID
     * @return 平台客户档案
     */
    @Override
    public ZsyhPlatformUser selectZsyhPlatformUserById(String id)
    {
        return zsyhPlatformUserMapper.selectZsyhPlatformUserById(id);
    }
    public ZsyhPlatformUser selectZsyhPlatformUserByPhone(String userPhone){
        return zsyhPlatformUserMapper.selectZsyhPlatformUserByPhone(userPhone);
    }

    public ZsyhPlatformUser selectZsyhPlatformUserByOpenId(String openId){
        return zsyhPlatformUserMapper.selectZsyhPlatformUserByOpenId(openId);
    }
    public ZsyhPlatformUser selectZsyhPlatformUserByPromotionCode(String promotionCode){
        return zsyhPlatformUserMapper.selectZsyhPlatformUserByPromotionCode(promotionCode);
    }


    /**
     * 查询平台客户档案列表
     * 
     * @param zsyhPlatformUser 平台客户档案
     * @return 平台客户档案
     */
    @Override
    public List<ZsyhPlatformUser> selectZsyhPlatformUserList(ZsyhPlatformUser zsyhPlatformUser)
    {
        return zsyhPlatformUserMapper.selectZsyhPlatformUserList(zsyhPlatformUser);
    }

    /**
     * 新增平台客户档案
     * 
     * @param zsyhPlatformUser 平台客户档案
     * @return 结果
     */
    @Override
    public int insertZsyhPlatformUser(ZsyhPlatformUser zsyhPlatformUser)
    {
        zsyhPlatformUser.setCreateTime(DateUtils.getNowDate());
        return zsyhPlatformUserMapper.insertZsyhPlatformUser(zsyhPlatformUser);
    }

    /**
     * 修改平台客户档案
     * 
     * @param zsyhPlatformUser 平台客户档案
     * @return 结果
     */
    @Override
    public int updateZsyhPlatformUser(ZsyhPlatformUser zsyhPlatformUser)
    {
        zsyhPlatformUser.setUpdateTime(DateUtils.getNowDate());
        return zsyhPlatformUserMapper.updateZsyhPlatformUser(zsyhPlatformUser);
    }

    /**
     * 删除平台客户档案对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPlatformUserByIds(String ids)
    {
        return zsyhPlatformUserMapper.deleteZsyhPlatformUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除平台客户档案信息
     * 
     * @param id 平台客户档案ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPlatformUserById(String id)
    {
        return zsyhPlatformUserMapper.deleteZsyhPlatformUserById(id);
    }
}
